﻿using ComUIControl;
using CoreBroker;
using KWindow.KPageCore;
using LogLib;
using System.Diagnostics;

namespace IPCPages
{
    public class ProcessDetectPhoto : PageProcessBase<ProcessDetectPhoto>
    {
        private Taker _taker = null;
        private ProcessDetectPhoto() : base()
        {

        }

        public override void Init()
        {
            base.Init();
        }

        public override void Exit()
        {
            base.Exit();
        }

        public override void InitData()
        {
            base.InitData();
            _taker = GetValue<Taker>("Taker");           
        }

        public override void UpdateData()
        {
            base.UpdateData();
        }

        public override void StartWork()
        {
            base.StartWork();
            if(_taker == null)
            {
                Log.WriteAsync("意外：获取到拍照控制对象为空.");
                MsgBox.Show("意外：获取到拍照控制对象为空.");
                return;
            }
            _taker.WaitForTasksCompletedAsync();
        }

        public override void StopWork()
        {
            base.StopWork();
        }

        public override void PlayWelcomeVoice()
        {
            base.PlayWelcomeVoice();
        }
    
    }
}
